import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);
const routes = [{
		path: '/Monitoring',
		name: '实时监控',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		// 路由中需要设置meta，其中subMenu指示是否为子菜单
		// icon为选项前图标class的名称
		meta: {
			subMenu: true,
			icon: 'icon-shishijiankong'
		},
		children: [{
			path: 'Net',
			name: '线网监控（CMD）',
			component: () => import('../views/RealTimeMonitoring/LineMonitoring.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}, {
			path: 'Line',
			name: '线路监控',
			component: () => import('../views/HealthManage/View1.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}, {
			path: 'SignleCar',
			name: '单车信息监控（CMD）',
			component: () => import('../views/RealTimeMonitoring/SingleCar.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}, {
			path: 'emergency',
			name: '应急管理',
			component: () => import('../views/RealTimeMonitoring/EmergencyFlowChart.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}, {
			path: 'KeyCircult ',
			name: '关键回路',
			component: () => import('../views/RealTimeMonitoring/CircuitmonitorPage.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}, {
			path: 'softwareVersion',
			name: '软件版本管理',
			component: () => import('../views/RealTimeMonitoring/SoftwareVersionManage'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}]
	},
	{
		path: '/FaultManage',
		name: '故障管理',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-guzhangguanli'
		},
		children: [{
				path: 'FaultAlert',
				name: '故障报警',
				component: () => import('../views/FaultManage/FaultAlertPage.vue'),
				meta: {
					subMenu: false,
					icon: ''
				}
			},
			{
				path: 'FaultInfo',
				name: '故障统计分析',
				component: () => import('../views/FaultManage/FaultInfoPage'),
				meta: {
					subMenu: false,
					icon: ''
				}
			}]
	},
	{
		path: '/Statistic',
		name: '统计分析',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-tongjifenxi'
		}
	},
	{
		path: '/HealthManage',
		name: '健康管理',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		// redirect: '/HealthManage/TrainScore',
		meta: {
			subMenu: true,
			icon: 'icon-jiankangguanli'
		},
		children: [{
				path: 'Vehicle',
				name: '整车',
				component: () => import('../views/HealthManage/HealthManage.vue'),
				meta: {
					subMenu: true,
					icon: ''
				},
				children: [{
						path: 'TrainScore',
						name: '车辆评分',
						component: () => import('../views/HealthManage/TrainScore.vue'),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'WeightsConfig',
						name: '权重配置',
						component: () => import("../views/HealthManage/View1.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					}
				]
			},
			{
				path: 'SubPHM',
				name: '子系统PHM',
				component: () => import("../views/HealthManage/SubPHM.vue"),
				meta: {
					subMenu: true,
					icon: ''
				},
				children: [{
						path: 'phmMenu',
						name: '总览',
						component: () => import("../views/HealthManage/PHM/PHMMenu.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
				    },
					{
						path: 'door',
						name: '车门',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'bow',
						name: '弓网',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'airCon',
						name: '空调',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'drag',
						name: '牵引',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'stop',
						name: '制动',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					},
					{
						path: 'bogie',
						name: '走行部',
						component: () => import("../views/HealthManage/PHM/View2.vue"),
						meta: {
							subMenu: false,
							icon: ''
						}
					}
				]
			}

		]
	},

	{
		path: '/Knowledge',
		name: '专家知识库',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-zhuanjiazhishiku'
		},
		children: [{
			path: 'DocManagement',
			name: '文档管理',
			component: () => import('../views/KnowledgeBase/DocManagement.vue'),
			meta: {
				subMenu: false,
				icon: ''
			}
		}]
	},
	{
		path: '/AssetManage',
		name: '资产管理',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-zichanguanli'
		}
	},
	{
		path: '/MaintenanceManage',
		name: '检修管理',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-jianxiuguanli'
		}
	},

	{
		path: '/Setting',
		name: '系统设置',
		component: () => import('../views/HealthManage/HealthManage.vue'),
		meta: {
			subMenu: true,
			icon: 'icon-xitongshezhi'
		}
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
